﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace ContributionDeposit
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            //routes.MapMvcAttributeRoutes();
            #region "ImportController"
            routes.MapRoute(
              name: "ImportCompany",
              url: "Import/Import-Company",
              defaults: new
              {
                  controller = "Import",
                  action = "ImportCompany"
              }
            );
            routes.MapRoute(
             name: "ImportPort",
             url: "Import/Import-Port",
             defaults: new
             {
                 controller = "Import",
                 action = "ImportPort"
             }
           );
            #endregion

            #region Login
            routes.MapRoute(
            name: "Login",
            url: "Login/User-Login",
            defaults: new
            {
                controller = "Account",
                action = "Login",
            }
          );
            #endregion 

            #region UserAccount
          routes.MapRoute(
            name: "ListUserAccount",
            url: "UserAccount/List-User",
            defaults: new
            {
                controller = "UserAccount",
                action = "ListUserAccount",
            }
          );

          routes.MapRoute(
             name: "AddUserAccount",
             url: "UserAccount/Add-User",
             defaults: new
             {
                 controller = "UserAccount",
                 action = "AddUser",
             }
          );

          routes.MapRoute(
             name: "EditUserAccount",
             url: "UserAccount/Edit-User/{UserId}",
             defaults: new
             {
                 controller = "UserAccount",
                 action = "Edituser",
                 UserId = UrlParameter.Optional
             }
          );

          routes.MapRoute(
            name: "ChangePassUserAccount",
            url: "UserAccount/Change-Password-User/{UserId}",
            defaults: new
            {
                controller = "UserAccount",
                action = "ChangePass",
                UserId = UrlParameter.Optional
            }
          );
          routes.MapRoute(
            name: "ChangePassSuccessUserAccount",
            url: "UserAccount/Change-Password-User-Success",
            defaults: new
            {
                controller = "UserAccount",
                action = "ChangePassSuccess",
            }
          );
            #endregion

            #region Port

          routes.MapRoute(
            name: "Port",
            url: "Port/List-Port",
            defaults: new
            {
                controller = "Port",
                action = "Index",
            }
          );

          routes.MapRoute(
            name: "AddPort",
            url: "Port/Add-Port",
            defaults: new
            {
                controller = "Port",
                action = "AddPort",
            }
          );

          routes.MapRoute(
            name: "EditPort",
            url: "Port/Edit-Port/{portId}",
            defaults: new
            {
                controller = "Port",
                action = "EditPort",
                portId = UrlParameter.Optional
            }
         );
          #endregion 

            #region Company

              routes.MapRoute(
                name: "Company",
                url: "Company/List-Company",
                defaults: new
                {
                    controller = "Company",
                    action = "Index",
                }
              );

              routes.MapRoute(
                name: "AddCompany",
                url: "Company/Add-Company",
                defaults: new
                {
                    controller = "Company",
                    action = "AddCompany",
                }
              );

              routes.MapRoute(
                name: "EditCompany",
                url: "Company/Edit-Company/{companyId}",
                defaults: new
                {
                    controller = "Company",
                    action = "EditCompany",
                    companyId = UrlParameter.Optional
                }
             );
              #endregion 

            #region Country

            routes.MapRoute(
                name: "Country",
                url: "Country/List-Country",
                defaults: new
                {
                    controller = "Country",
                    action = "Index",
                }
            );

            routes.MapRoute(
                name: "DetailCountry",
                url: "Country/Detail-Country/{id}",
                defaults: new
                {
                    controller = "Country",
                    action = "Details",
                    id = UrlParameter.Optional
                }
            );

            routes.MapRoute(
                name: "AddCountry",
                url: "Country/Create-Country",
                defaults: new
                {
                    controller = "Country",
                    action = "Create",
                }
            );

            routes.MapRoute(
                name: "EditCountry",
                url: "Country/Edit-Country/{id}",
                defaults: new
                {
                    controller = "Country",
                    action = "Edit",
                    id = UrlParameter.Optional
                }
            );
            #endregion 

            #region ContributionRate

            //routes.MapRoute(
            //    name: "DetailCountry",
            //    url: "Country/Detail-Country/{id}",
            //    defaults: new
            //    {
            //        controller = "Country",
            //        action = "Details",
            //        id = UrlParameter.Optional
            //    }
            //);

            #endregion
              routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
         );

          
        }
    }
}
